<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>底部</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0" />
    <link rel="stylesheet" href="./css/index.css"/>
    <script src="./js/jquery.js"></script>
    <script src="js/base.js"></script>
    <script src="lib/vue/vue.min.js"></script>
    <script src="lib/vue/vue-resource.min.js"></script>
</head>
<script type="text/javascript">
    (function () {
        var deviceWidth = document.documentElement.clientWidth;
        if (deviceWidth > 640) deviceWidth = 640;
        document.documentElement.style.fontSize = deviceWidth / 6.4 + 'px';
    }());
</script>
<body>
<div id="appa">
    <footer class="foot">
        <p class="foot1"><img src="./images/bttom-logo.png" alt=""/> <span>优租云，专为虚拟机而生</span></p>
        <p class="foot2">
            <a href="./registrationAgreement.html"><span class="bottom_color">用户注册和使用协议</span></a>
            <i></i>
            <a style="color: #fff;" href="./serviceRegulations.html"><span>虚拟机使用规则</span></a>
            <i></i>
            <span style="cursor: pointer" class="feed" @click="feedBacka()">用户反馈</span>
            <i></i>
            <a style="color: #fff;" href="survey.html"><span>问卷调查</span></a>
        </p>
        <p class="foot3" >©2018郑州优租云网络科技有限公司。All Rights Reserved。 豫ICP备86588888号</p>
    </footer>
    <div class="popup" id="question" style="display: none">
        <div class="popup_vanish"></div>
        <div class="popupN">
            <div class="feed">
                <p>用户意见和反馈</p>
                <textarea id="text"></textarea>
                <div class="Btn" @click="feedSubmit()"><button >提交</button></div>
            </div>
        </div>
    </div>
</div>
<script>
    (function () {
        var appa = new Vue({
            el: '#appa',
            data: function () {
                return{

                }
            },
            mounted: function () {
//需要执行的方法可以在mounted中进行触发，其获取的数据可以赋到data中后，可以放在前面进行渲染
            },
            methods: {
                feedBacka:function(){
                    var _this = this;
                    get(url + 'user/info', {}).then(
                            function (res) {
                                if (res.body.code == 401) {
                                    tip(res.body.msg);
                                    location.href = './login.html'
                                } else if (res.body.code == 400) {
                                    tip(res.body.msg) ;
                                } else {
                                    $('#question').css('display','block')
                                }
                            }, function (reason) {
                                tip('请求错误')
                            });

                },
                feedSubmit:function(){
                    let _this =this
                    var cont = $('#text').val()
                    post(url + 'crm/feed-back', {content:cont})
                            .then(function (res) {
                                if (res.body.code == '101') {
                                    tip(res.body.msg)
                                    location.href = './login.html'
                                }else if(res.body.code==400){
                                    tip(res.body.msg);
                                }else{
                                    _this.showData();
                                    $('#question').css('display','none')
                                }
                            }, function (reason) {
                                tip('请求错误')
                            });
                }
            }
        })
    })()
    $('.popup_vanish').click(function(){
        $('#question').css('display','none')
    })
</script>
</body>
</html>